﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xiami.Helper
{
    public class Decode
    {
        protected virtual string DecodeXmlUrl(string playerurl)
        {
            string str = "song/play?ids=/";

            int index = playerurl.IndexOf(str);
            if (index < 0)
            {
                return "";
            }
            return playerurl.Substring(0, index) + playerurl.Substring(index + str.Length);
        }

        public Model.TrackListInfo GetTrackData(string url)
        {
            Method.GetListData getListData = new Method.GetListData();
            string xmlurl = DecodeXmlUrl(url);
            Model.TrackListInfo list = getListData.GetList(xmlurl);
            return list;
        }
    }
}
